import http from "@/common/http/request";
import {
  musicApplicationChordsListInterface,
  musicApplicationChordsAddInterface,
  musicApplicationChordsUpdateInterface,
} from "./applicationChords.interface";

// 应用和弦列表
export const $musicApplicationChordsList = (data: musicApplicationChordsListInterface) => {
  const $http = new http();
  return $http.get({
    url: '/music/applicationChords/list',
    data,
  })
}

// 应用和弦详情
export const $musicApplicationChordsDetail = (id: string) => {
  const $http = new http();
  return $http.get({
    url: `/music/applicationChords/${id}`,
  })
}

// 新增应用和弦
export const $musicApplicationChordsAdd = (data: musicApplicationChordsAddInterface) => {
  const $http = new http();
  return $http.post({
    url: '/music/applicationChords',
    data,
  })
}

// 修改应用和弦
export const $musicApplicationChordsUpdate = (data: musicApplicationChordsUpdateInterface) => {
  const $http = new http();
  return $http.put({
    url: '/music/applicationChords',
    data,
  })
}

// 删除应用和弦
export const $musicApplicationChordsDelete = (data: Array<string>) => {
  const $http = new http();
  return $http.delete({
    url: `/music/applicationChords/${data.join(',')}`,
  })
}